package com.shuma.product.controller;

import com.shuma.model.result.Result;
import com.shuma.rpc.product.StatisticsService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("/statistics")
@Api(tags = "统计接口")
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;
    @GetMapping("/exchange")
    public Result exchange(@DateTimeFormat(pattern = "yyyy-MM-dd")
                               LocalDate startTime,
                           @DateTimeFormat(pattern = "yyyy-MM-dd")
                               LocalDate endTime) {
        return statisticsService.exchange(startTime,endTime);
    }
}
